from django.db import models


# 用户信息表
class UserInfo(models.Model):
    username = models.CharField(max_length=128, unique=True, null=False)
    password = models.CharField(max_length=128, null=False)
    phone = models.CharField(max_length=11, unique=True, null=False)
    email = models.CharField(max_length=128, null=False)


# 图片信息表
class ImageInfo(models.Model):
    p_name = models.CharField(max_length=128, null=False)
    p_sex = models.CharField(max_length=128, null=False)
    p_age = models.IntegerField(null=False)
    doctor = models.CharField(max_length=128, null=False)
    stage = models.CharField(max_length=128, null=False)
    date = models.CharField(max_length=128, null=False)
    image_name = models.CharField(max_length=128, null=False)
    image_file = models.ImageField(upload_to='image', unique=True, null=False)
    is_ready = models.BooleanField(default=False)
    is_finish = models.BooleanField(default=False)


# 生成图片表
class ExtraImage(models.Model):
    old_image_base64 = models.ImageField(unique=True, null=False)
    point_image_base64 = models.ImageField(null=True)
    outlines_image_base64 = models.ImageField(null=True)
    point_and_outlines_image_base64 = models.ImageField(null=True)


# 配准图片表
class RegistrateImage(models.Model):
    fixed_image = models.ImageField(null=True)
    moving_image = models.ImageField(null=True)
    original_image = models.ImageField(null=True)
    point_image = models.ImageField(null=True)
    outlines_image = models.ImageField(null=True)
    complete_image = models.ImageField(null=True)